package com.metal.gear.certification.entity.vo.dept;

import com.metal.gear.certification.entity.po.SysDepart;
import com.metal.gear.common.util.tree.SzlTreeNode;
import io.swagger.v3.oas.annotations.media.Schema;
import org.springframework.beans.BeanUtils;

@Schema(name = "完整的组织机构树形结构")
public class SysDepartTreeVo extends SzlTreeNode<String, SysDepartTreeVo> {


    @Schema(name ="机构/部门名称")
    private String departName;

    @Schema(name ="机构/部门名称缩写")
    private String departNameAbbr;

    @Schema(name ="排序")
    private Integer departOrder;

    public static SysDepartTreeVo convertFrom(SysDepart po) {
        SysDepartTreeVo vo = new SysDepartTreeVo();
        BeanUtils.copyProperties(po, vo);
        vo.setWeight(po.getDepartOrder());
        return vo;
    }

}
